from django.db import models


# Create your models here.
class Heros(models.Model):
    name = models.CharField(max_length=255, null=False, verbose_name='英雄名字')
    hp_max = models.FloatField(null=True, verbose_name='最大血量')
    hp_growth = models.FloatField(null=True, verbose_name='血量增长值')
    hp_start = models.FloatField(null=True, verbose_name='起始血量')
    mp_max = models.FloatField(null=True, verbose_name='最大蓝量')
    mp_growth = models.FloatField(null=True, verbose_name='蓝量增长值')
    mp_start = models.FloatField(null=True, verbose_name='起始蓝量')
    attack_max = models.FloatField(null=True, verbose_name='攻击最大值')
    attack_growth = models.FloatField(null=True, verbose_name='攻击增长值')
    attack_start = models.FloatField(null=True, verbose_name='起始攻击')
    defense_max = models.FloatField(null=True, verbose_name='最大防御')
    defense_growth = models.FloatField(null=True, verbose_name='防御增长值')
    defense_start = models.FloatField(null=True, verbose_name='起始防御')
    hp_5s_max = models.FloatField(null=True, verbose_name='每5秒血量恢复最大值')
    hp_5s_growth = models.FloatField(null=True, verbose_name='每5秒血量恢复增长')
    hp_5s_start = models.FloatField(null=True, verbose_name='每5秒血量恢复起始值')
    mp_5s_max = models.FloatField(null=True, verbose_name='每5秒蓝量恢复最大值')
    mp_5s_growth = models.FloatField(null=True, verbose_name='每5秒蓝量恢复增长')
    mp_5s_start = models.FloatField(null=True, verbose_name='每5秒蓝量恢复起始值')
    attack_speed_max = models.FloatField(null=True, verbose_name='最大攻击速度')
    attack_range = models.CharField(max_length=255, null=True, verbose_name='攻击范围')
    role_main = models.CharField(max_length=255, null=True, verbose_name='主定位')
    role_assist = models.CharField(max_length=255, null=True, verbose_name='次定位')
    birthdate = models.DateField(null=True, verbose_name='英雄生成日期')

    class Meta:
        db_table = 'tb_heros'

    def __str__(self):
        return self.name


class User(models.Model):
    user_id = models.IntegerField(verbose_name='用户id')
    user_password = models.IntegerField(verbose_name='用户密码')

    class Meta:
        db_table = 'tb_user'

    def __str__(self):
        return self.user_id
